function onStart()
	--Text.windowDebug("yey")
	Defines.player_walkspeed = 4.25
end

-- Insert code that kills the player upon collecting a star. 

local Speeder = 10
local starman = require("npcs/ai/starman")

function onTick()

	if globalsave.HardMode then 
		Speeder = 15
		for _,plyr in ipairs(Player.get()) do
			if plyr._hasStarman() then
				starman.stop(plyr)
				plyr:kill()
			end
		end
	else
		Speeder = 10
	end
    for key, value in pairs(NPC.get(285,-1)) do
		if (value.direction == -1) then
			value.speedY = Speeder;
		else
			value.speedY = -Speeder;
		end
		
		if (value.y < value.sectionObj.boundary.top) or (value.y > value.sectionObj.boundary.bottom) then
			value:kill(0);
		end
    end
	for key, value in pairs(NPC.get(612,-1)) do
		if (value.direction == -1) then
			value.speedY = Speeder;
		else
			value.speedY = -Speeder;
		end
		
		if (value.y < value.sectionObj.boundary.top) or (value.y > value.sectionObj.boundary.bottom) then
			value:kill(0);
		end
    end
	
	for _,plyr in ipairs(Player.get()) do -- disable run key, and disable wall jump
		plyr.keys.run = false
		aw.preventWallSlide(plyr)
	end
end

function onNPCHarm(eventToken, killedNPC, harmType, culpritOrNil)
	if killedNPC.id == 293 then
		print("oof ouchie my star bones: " .. harmType .. " " .. culpritOrNil)
	end
end

function onPostPlayerHarm(player)
	if globalsave.HardMode then
		if player.deathTimer == 0 then
			player:kill()
		end
	end
end